@extends('Layout/base')

@section('title', '个人中心，万表商城')

@section('css')
<link rel="stylesheet" href="{{asset('/common/bootstrap-3.3.7/css/bootstrap.min.css')}}" type="text/css" media="screen, projection">
<link rel="stylesheet" href="{{asset('/common/home/css/user.css')}}" type="text/css" media="screen, projection">
<link rel="stylesheet" href="{{asset('/common/home/css/user.css')}}">
@endsection

@section('main-js')
 <script type="text/javascript" src="{{asset('common/home/js/jquery.js')}}"></script>
    <script type="text/javascript" src="{{asset('common/home/js/jquery-1.12.3.min.js')}}"></script>
<script src="{{asset('/common/home/js/saved_resource')}}"></script>
<script type="text/javascript" src="{{asset('/common/home/js/user.js')}}"></script>
@endsection

@section('main')
<div id="main">
<div class="position">
    <a href="{{asset('/')}}"><strong>首页</strong></a>
    <i>&gt;</i>
    <a href="{{asset('/usercenter')}}" target="_blank" class="c0e7">我的喜悦手表</a>
    <i>&gt;</i>
    <span>我的订单</span>
</div>
<div class="rightArea" style="border: 1px solid #ccc">
    <!-- 便利提醒 Begin -->
    <div class="prompt">
        <div class="pr_top" style=" ">
            <b class="tit">基本资料</b>
           <!--  <div id="contact_kf_div2" style="float: right;"><a href="javascript:;" class="btn btn-danger btn-register">编辑</a></div> -->
        </div>

    </div>
    <!-- 便利提醒 End -->

    <div class="clear"></div>
        <!-- order表单 Begin -->
    <div class="odrTab">
        <!-- <div class="ot_top"> -->
            <!-- <form action=""> -->
                <!-- <div class="left">
                    <select name="datetime">
                        <option selected="selected" value="">所有订单</option>
                        <option value="1">近一个月订单</option>
                        <option value="2">近三个月订单</option>
                        <option value="3">近一年订单</option>
                    </select>
                    <select name="order_status">
                        <option value="">全部状态</option>
                            <option value="1">未确认</option>
                            <option value="2">确认中</option>
                            <option value="3">已确认</option>
                            <option value="4">待发货</option>
                            <option value="5">分单发货中</option>
                            <option value="6">已发货</option>
                            <option value="7">已取消</option>
                            <option value="8">待支付</option>
                    </select>

                </div> -->
                <!-- <div class="right">
                    &lt;订单编号：&gt;
                    <input type="text" class="txt" name="order_id" value="" onfocus="javascript:$(this).val(&#39;&#39;);">
                    <input type="submit" class="lookup" value="查询">
                </div> -->
            <!-- </form> -->
        <!-- </div> -->
    </div>
    <div class="account" style="margin-left: 30px">
        <div class="hisOrd">
            @foreach($userdata as $v)
            <!-- <form action="{{url('/home/personaldataupdata')}}" method="post" class="shop_form"> -->
                
                <div class="form-group" style="font-size: 12px">              
                    <ul>                           
                        <li style="line-height: 40px;font-size: 16px;" ><label>亲！完善资料，有助于好友找到你哦！</label></li>

                        <form action="{{url('/upload')}}" method="post" enctype="multipart/form-data">
                            {{ csrf_field() }}
                            <li style="line-height: 40px"><label style="width: 70px">当前头像：</label><img src="{{asset('upload/image/mTlGn8gwy7MyQc2wCGpHB2qpYydRS94T8Gztmk4M.jpeg')}}" width="200" height="100px"><input type="file" name="img"></li>
                            <button type="submit">上传</button>
                        </form>

                        <input type="hidden" value="{{$v->id}}" name="id">
                        <li style="line-height: 40px"><label style="width: 70px">用户名：</label><input type="text" value="{{$v->user_name}}" name="username" style="height: 30px; width: 200px"><span id="errorname"></span></li>
                         <li style="line-height: 40px"><label style="width: 70px">真实姓名：</label><input type="text" value="{{$v->name}}" name="name" style="height: 30px;width: 200px" placeholder="请输入你的真实姓名"></li>
                        <li style="line-height: 40px"><label style="width: 70px">电子邮件：</label><input type="text" value="{{$v->email}}" name="email" style="height: 30px;width: 200px;"></li>                         
                        <li style="line-height: 40px"><label style="width: 70px">手机号码：</label><input type="text" value="{{$v->phone}}" name="phone" style="height: 30px;width: 200px"><span id="errorphone"></span></li>
                       <!--  <li style="line-height: 40px"><label style="width: 70px">地&nbsp;&nbsp;&nbsp;址：</label></li> -->
                        <li style="line-height: 40px"><label style="width: 70px">性&nbsp;&nbsp;&nbsp;别：</label>
                            <input type="radio" name="sex" value="1" {{$v->sex==1?'checked':"" }}>男&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="sex" value="0" {{$v->sex==0?'checked':"" }}>女
                        </li>
                         <span id="success" style="display: block;margin-left:100px "></span>
                        <li class="bn"><button type="submit" class="btn btn-success" id="submit" style="margin-left: 100px">保存</li>                        
                    </ul>
                 </div>
            <!-- </form> -->
            @endforeach        
        </div>
    </div>
    <!-- order表单 End -->

    <!-- 翻页 Begin -->
        <!-- 翻页 End -->

</div>

<!-- 左边菜单 Begin -->
<div class="leftArea">
    <div class="leftArea">
   <!--  <div class="u__mine"><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_index&#39;,&#39;http:user.wbiao.cn/&#39;]);" href="http://user.wbiao.cn/" style="display: block; height: 100%;"></a></div> -->
    <div class="floor">
        <div class="t"><i class="u__trade"></i><font class="f_fixed">交易管理</font></div>
        <div class="c">
            <ul>
                <li><i class="u__point"></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_order&#39;,&#39;/order&#39;]);" href="Script/yonghu.htm" class="ccf0" title="我的订单" rel="nofollow">我的订单 (<span class="cb01">1</span>)</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_orderbooking&#39;,&#39;/orderbooking&#39;]);" href="#" title="我的预售" rel="nofollow">我的预售 (<span class="cb01">0</span>)</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_address&#39;,&#39;/address&#39;]);" href="#" title="收货地址" rel="nofollow">收货地址</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_giftcard&#39;,&#39;/giftcard&#39;]);" href="#" title="礼品卡" rel="nofollow">礼品卡</a></li>
                <li style="border:0;"><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_bonus&#39;,&#39;/bonus&#39;]);" href="#" title="代金券/优惠券" rel="nofollow">代金券/优惠券</a></li>
            </ul>
        </div>
    </div>
    <div class="floor">
        <div class="t"><i class="u__datum"></i><font class="f_fixed">账户管理</font></div>
        <div class="c">
            <ul>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_profile&#39;,&#39;/profile&#39;]);" href="#" title="个人资料" rel="nofollow">个人资料</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_password&#39;,&#39;/password&#39;]);" href="#" title="修改密码" rel="nofollow">修改密码</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_collection&#39;,&#39;/collection&#39;]);" href="#" title="我的收藏" rel="nofollow">我的收藏</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_history_record&#39;,&#39;/history/record&#39;]);" href="#" title="浏览历史" rel="nofollow">浏览历史</a></li>
                <li style="border:0;"><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_recommend&#39;,&#39;/recommend&#39;]);" href="http://user.wbiao.cn/recommend" title="为我推荐" rel="nofollow">为我推荐</a></li>
            </ul>
        </div>
    </div>
    <div class="floor">
        <div class="t"><i class="u__integral"></i><font class="f_fixed">积分管理</font></div>
        <div class="c">
            <ul>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_points&#39;,&#39;/points&#39;]);" href="#" title="我的积分" rel="nofollow">我的积分</a></li>
                <li><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_points_detail&#39;,&#39;/points/detail&#39;]);" href="#" title="积分细则" rel="nofollow">积分细则</a></li>
                <li style="border:0;"><i></i><a onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;user&#39;,&#39;user_recommend_gift&#39;,&#39;/recommend/gift&#39;]);" href="#" title="推荐有礼" rel="nofollow">推荐有礼</a></li>
            </ul>
        </div>
    </div>
    <div class="floor">
        <div class="t"><i class="u__service"></i><font class="f_fixed">消息管理</font></div>
        <div class="c">
            <ul>
                <li><i></i><a href="#" title="购买咨询" rel="nofollow">购买咨询</a></li>
                <li><i></i><a href="#" title="我的评论" rel="nofollow">我的评论</a></li>
                <li style="border:0;"><i></i><a href="#" title="我的消息" rel="nofollow">我的消息</a></li>
                <li style="border:0;"><i></i><a href="#" title="促销通知" rel="nofollow">促销通知</a></li>
            </ul>
        </div>
    </div>
    <div class="floor">
        <div class="t"><i class="u__star"></i><font class="f_fixed">喜悦手表会员</font></div>
        <div class="c">
            <ul>
                <li><i></i><a href="#" title="会员简介" rel="nofollow">会员简介</a></li>
            </ul>
        </div>
    </div>
    <div class="logout">
        <a href="#" class="c999">退出登录</a>
    </div>
</div></div>
<!-- 左边菜单 End -->

</div>
<div id="floatBox">
    <div id="return">
        <a href="javascript:void(0);" class="c__gotop" title="返回顶部" style="display:none;" rel="nofollow"></a>
    </div>
</div>


<script type="text/javascript">
    $('button#submit').click(function () {
        // alert(2);
        var username = $('input[name="username"]').val();
        var name = $('input[name="name"]').val();
        var sex = $('input[name="sex"]').val();
        var phone = $('input[name="phone"]').val();
        var email = $('input[name="email"]').val();
        var id = $('input[name="id"]').val();
        $('#errorname').html('');
        $('#errorphone').html('');
        $('#success').html('');
        $.ajax({
            type: 'post',
            url: "{{url('/home/personaldataupdata')}}",
            data: 'uname='+username+'&name='+name+'&_token={{csrf_token()}}'+'&phone='+phone+'&email='+email+'&sex='+sex+'&id='+id,
            success:function (data) {
                console.log(data);
                if (data.status==1) {
                    $('#errorname').html(data.msg).css('color','red');
                    return false;
                }
                 if (data.status==2) {
                    $('#errorphone').html(data.msg).css('color','red');
                    return false;
                }
                 if (data.status==200) {
                    $('#success').html(data.msg).css('color','red');
                    location.href ='{{url("/home/personal")}}';
                }
                if (data.status==3) {
                    $('#success').html(data.msg).css('color','red');
                    return false;
                }
            },
            error:function (err) {},
            dataType:'json'
        });
    });

</script>


@endsection
